//
//  ORMRecord.m
//  SouthChina
//
//  Created by creator_lq on 14/12/3.
//  Copyright (c) 2014年 科创. All rights reserved.
//

#import "ORMRecord.h"

@implementation ORMRecord

@synthesize upate_time;
@synthesize otherInfo;


-(NSDictionary*) getOtherInfoContentMap
{
    if(!self.otherInfo){
        return nil;
    }
    NSDictionary * conetMap  = [self.otherInfo objectFromJSONString];
    return conetMap;
    
}

-(id)getValue:(NSString*)key
{
    if(!self.otherInfo){
        return nil;
    }
    
    NSDictionary * conetMap  = [self.otherInfo objectFromJSONString];
    return [conetMap objectForKey:key];
    
}

-(void)putValue:(id)vlaue key:(NSString*)key{
    
    NSMutableDictionary * conetMap  = nil;
    
    if(!self.otherInfo){
        conetMap = [[NSMutableDictionary alloc] init];
    }
    else{
        conetMap = [[NSMutableDictionary alloc] initWithDictionary:[self.otherInfo objectFromJSONString]];
    }
    
    [conetMap setValue:vlaue forKey:key];
    self.otherInfo = [conetMap JSONString];

}

-(void)putValues:(NSDictionary*) maps{
    
    if (maps == nil)
        return;
    
    NSMutableDictionary * conetMap  = nil;
    if(!self.otherInfo){
        conetMap = [[NSMutableDictionary alloc] init];
    }
    else{
        conetMap = [[NSMutableDictionary alloc] initWithDictionary:[self.otherInfo objectFromJSONString]];
    }
    
    [conetMap addEntriesFromDictionary:maps];
        
    NSString *jsonStr = [conetMap JSONString];
    
    self.otherInfo =jsonStr;

    
}

-(NSDate*)getUpdateTime{
    return self.upate_time;
}



@end
